package com.flca.frw.log;

import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;

public class StacktraceHelper {

	/**
	 * Use this method to log the entire stack trace to a logfile
	 * @param t
	 * @return
	 */
	public static String getStacktrace(Throwable t) 
	{
		OutputStream os = new ByteArrayOutputStream();
		PrintWriter writer = new PrintWriter(os);
		t.printStackTrace(writer);
		writer.flush();
		return os.toString();
	}
}
